<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../../common/taglibs.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html:html>
<head>
	<%
		request.setCharacterEncoding("UTF-8");
	%>

	<base href="<%=basePath%>">
	<link rel="stylesheet" href="css/css.css" type="text/css"></link>
	<link rel="stylesheet" href="css/jquery.datepick.css" type="text/css"></link>
	<style type="text/css">
#leftSide {
	float: left;
	height: auto;
	width: 50%;
}

#rightSide {
	float: left;
	height: auto;
	width: 50%;
}
</style>
	<script type="text/javascript" src="js/global.js"></script>
	<script type="text/javascript" src="js/calendar.js"></script>
	<script type="text/javascript" src="js/jquery/jquery-1.7.2.js"></script>
	<script type="text/javaScript" src="js/jquery/jquery.datepick.js"></script>
	<script type="text/javaScript" src="js/jquery/jquery.datepick.lang.js"></script>
	<script type="text/javaScript" src="js/jquery/jquery.datepick-zh-CN.js"></script>
	<script type="text/javaScript">
	  var retailer;
		$(function() {
		 $(".mydate").datepick();
		 $("#mainTable >tbody >tr").click(
					function() {
					 $('#mainTable >tbody >tr').each(
						function(index) {
							this.style.backgroundColor="#F5F5F5";	
						}
					);
					 this.style.backgroundColor="#0066CC";	
					 $(this).attr("pId","1");
					}
			);	
		$("#confirm").click(function() {
			    $('#mainTable >tbody >tr[pId!="0"]').each(
				function() {
				        retailer=$(this).find(".retailer").html();
				       	window.location.href="<%=basePath%>signContract/redetailerAcceptContractDealAction.do?method=confirm&retailer="+retailer;
				}); 
		});
	});
	</script>
</head>
<body>
	<table width="100%" height="29" border="0" cellpadding="0"
		cellspacing="0">
		<tr>
			<td background="images/top-5.gif"
				style="font-size: 14px; font-weight: bold;" align="center">
				签约管理
				<br>
			</td>
		</tr>
	</table>
	<table class="tab_back">
		<tr>
			<td>
				<table border=0 cellpadding=0 cellspacing=0 height=25>
					<tr align="center">
						<td width=5>
							&nbsp;
						</td>
						<td class="tab_left">
							&nbsp;
						</td>
						<td class="tab_on" valign="bottom" nowrap="nowrap">
							BSA审批页面
						</td>
						<td class="tab_right" valign="bottom">
							&nbsp;
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
	<form id="" name=""
		action="signContract/acceptContractAction.do?method=list"
		method="post">
		<table>
			<tr>
				<td>
					店名
				</td>
				<td>
					<input type="text" id="searchOrgName" name="searchOrgName" />
				</td>
				<td>
					城市
				</td>
				<td>
					<input type="text" id="searchCity" name="searchCity" />
				</td>
				<td>
					状态
				</td>
				<td>
					<select id="searchStatus" name="searchStatus">
						<option value="">
							初始化
						</option>
						<option value="A">
							申请中
						</option>
						<option value="G">
							已同意
						</option>
						<option value="R">
							拒绝
						</option>
						<option value="C">
							签约
						</option>
					</select>
				</td>
				<td>
					店类别：
				</td>
				<td>
					<select id="searchIndexSector" name="searchIndexSector">
						<option>
							请选择
						</option>
						<c:forEach items="${typeList}" var="type">
							<option value="${type.id}">
								${type.name}
							</option>
						</c:forEach>
					</select>
				</td>
				<td>
					<input type="submit" id="pSearch" name="pSearch" value="搜索" />
				</td>
			</tr>
		</table>
	</form>
	<table id="mainTable" bordercolor="blue" border="1" width="100%">
		<thead>
			<tr>
				<td width="9%">
					店编号
				</td>
				<td width="9%">
					店名
				</td>
				<td width="9%">
					零售店类别
				</td>
				<td width="9%">
					TPP数量
				</td>
				<td width="9%">
					TPP时间
				</td>
				<td width="9%">
					经销商
				</td>
				<td width="9%">
					经销商名称
				</td>
				<td width="9%">
					状态
				</td>
				<td width="9%">
					城市
				</td>
				<td width="9%">
					邮编
				</td>
				<td width="9%">
					地址
				</td>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${retailerList}" var="retailer">
				<tr pId="0">
					<td class="retailer">
						${retailer.retailer}
					</td>
					<td>
						${retailer.retailerNm}
					</td>
					<td>
						<select class="indSector" disabled="disabled">
							<c:forEach items="${typeList}" var="type">
								<option value="${type.id}"
									<c:if test="${retailer.indSector==type.id}">selected="selected" </c:if>>
									${type.name}
								</option>
							</c:forEach>
						</select>
					</td>
					<td>
						${retailer.tppNO}
					</td>
					<td>
						${retailer.tppDate}
					</td>
					<td>
						${retailer.distributor}
					</td>
					<td class="distributorNm">
						${retailer.distributorNm}
					</td>
					<td class="ztppStatus">
						<select disabled="disabled">
							<option value="">
								初始化
							</option>
							<option value="A"
								<c:if test="${retailer.ztppStatus=='A'}">selected="selected"</c:if>>
								申请中
							</option>
							<option value="G"
								<c:if test="${retailer.ztppStatus=='G'}">selected="selected"</c:if>>
								已同意
							</option>
							<option value="R"
								<c:if test="${retailer.ztppStatus=='R'}">selected="selected"</c:if>>
								拒绝
							</option>
							<option value="C"
								<c:if test="${retailer.ztppStatus=='C'}">selected="selected"</c:if>>
								签约
							</option>
						</select>
					</td>
					<td class="city">
						${retailer.city}
					</td>
					<td>
						${retailer.visitLoop}
					</td>
					<td>
						${retailer.street}
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<table>
		<tr>
			<td>
				<input type="button" id="confirm" value="签约" />
			</td>
			
		</tr>
	</table>
</body>
</html:html>
